.class public Lroboguice/util/SafeAsyncTask$Task;
.super Ljava/lang/Object;
.source "SafeAsyncTask.java"

# interfaces
.implements Ljava/util/concurrent/Callable;


# annotations
.annotation system Ldalvik/annotation/Signature;
    value = {
        "<ResultT:",
        "Ljava/lang/Object;",
        ">",
        "Ljava/lang/Object;",
        "Ljava/util/concurrent/Callable",
        "<",
        "Ljava/lang/Void;",
        ">;"
    }
.end annotation


# instance fields
.field protected b:Lroboguice/util/SafeAsyncTask;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Lroboguice/util/SafeAsyncTask",
            "<TResultT;>;"
        }
    .end annotation
.end field

.field protected c:Landroid/os/Handler;


# virtual methods
.method protected a()Ljava/lang/Object;
    .locals 1
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "()TResultT;"
        }
    .end annotation

    .prologue
    .line 191
    iget-object v0, p0, Lroboguice/util/SafeAsyncTask$Task;->b:Lroboguice/util/SafeAsyncTask;

    invoke-virtual {v0}, Lroboguice/util/SafeAsyncTask;->call()Ljava/lang/Object;

    move-result-object v0

    return-object v0
.end method

.method protected a(Ljava/lang/Exception;)V
    .locals 2
    .parameter

    .prologue
    .line 204
    iget-object v0, p0, Lroboguice/util/SafeAsyncTask$Task;->b:Lroboguice/util/SafeAsyncTask;

    iget-object v0, v0, Lroboguice/util/SafeAsyncTask;->g:[Ljava/lang/StackTraceElement;

    if-eqz v0, :cond_0

    .line 205
    new-instance v0, Ljava/util/ArrayList;

    invoke-virtual {p1}, Ljava/lang/Exception;->getStackTrace()[Ljava/lang/StackTraceElement;

    move-result-object v1

    invoke-static {v1}, Ljava/util/Arrays;->asList([Ljava/lang/Object;)Ljava/util/List;

    move-result-object v1

    invoke-direct {v0, v1}, Ljava/util/ArrayList;-><init>(Ljava/util/Collection;)V

    .line 206
    iget-object v1, p0, Lroboguice/util/SafeAsyncTask$Task;->b:Lroboguice/util/SafeAsyncTask;

    iget-object v1, v1, Lroboguice/util/SafeAsyncTask;->g:[Ljava/lang/StackTraceElement;

    invoke-static {v1}, Ljava/util/Arrays;->asList([Ljava/lang/Object;)Ljava/util/List;

    move-result-object v1

    invoke-virtual {v0, v1}, Ljava/util/ArrayList;->addAll(Ljava/util/Collection;)Z

    .line 207
    invoke-virtual {v0}, Ljava/util/ArrayList;->size()I

    move-result v1

    new-array v1, v1, [Ljava/lang/StackTraceElement;

    invoke-virtual {v0, v1}, Ljava/util/ArrayList;->toArray([Ljava/lang/Object;)[Ljava/lang/Object;

    move-result-object v0

    check-cast v0, [Ljava/lang/StackTraceElement;

    invoke-virtual {p1, v0}, Ljava/lang/Exception;->setStackTrace([Ljava/lang/StackTraceElement;)V

    .line 209
    :cond_0
    new-instance v0, Lroboguice/util/SafeAsyncTask$Task$3;

    invoke-direct {v0, p0, p1}, Lroboguice/util/SafeAsyncTask$Task$3;-><init>(Lroboguice/util/SafeAsyncTask$Task;Ljava/lang/Exception;)V

    invoke-virtual {p0, v0}, Lroboguice/util/SafeAsyncTask$Task;->a(Ljava/util/concurrent/Callable;)V

    .line 218
    return-void
.end method

.method protected a(Ljava/lang/Object;)V
    .locals 1
    .parameter
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(TResultT;)V"
        }
    .end annotation

    .prologue
    .line 195
    new-instance v0, Lroboguice/util/SafeAsyncTask$Task$2;

    invoke-direct {v0, p0, p1}, Lroboguice/util/SafeAsyncTask$Task$2;-><init>(Lroboguice/util/SafeAsyncTask$Task;Ljava/lang/Object;)V

    invoke-virtual {p0, v0}, Lroboguice/util/SafeAsyncTask$Task;->a(Ljava/util/concurrent/Callable;)V

    .line 201
    return-void
.end method

.method protected a(Ljava/util/concurrent/Callable;)V
    .locals 5
    .parameter

    .prologue
    const/4 v1, 0x1

    const/4 v4, 0x0

    .line 238
    new-instance v0, Ljava/util/concurrent/CountDownLatch;

    invoke-direct {v0, v1}, Ljava/util/concurrent/CountDownLatch;-><init>(I)V

    .line 239
    new-array v1, v1, [Ljava/lang/Exception;

    .line 245
    iget-object v2, p0, Lroboguice/util/SafeAsyncTask$Task;->c:Landroid/os/Handler;

    new-instance v3, Lroboguice/util/SafeAsyncTask$Task$5;

    invoke-direct {v3, p0, p1, v1, v0}, Lroboguice/util/SafeAsyncTask$Task$5;-><init>(Lroboguice/util/SafeAsyncTask$Task;Ljava/util/concurrent/Callable;[Ljava/lang/Exception;Ljava/util/concurrent/CountDownLatch;)V

    invoke-virtual {v2, v3}, Landroid/os/Handler;->post(Ljava/lang/Runnable;)Z

    .line 258
    invoke-virtual {v0}, Ljava/util/concurrent/CountDownLatch;->await()V

    .line 260
    aget-object v0, v1, v4

    if-eqz v0, :cond_0

    .line 261
    aget-object v0, v1, v4

    throw v0

    .line 263
    :cond_0
    return-void
.end method

.method public b()Ljava/lang/Void;
    .locals 1

    .prologue
    .line 164
    :try_start_0
    invoke-virtual {p0}, Lroboguice/util/SafeAsyncTask$Task;->c()V

    .line 165
    invoke-virtual {p0}, Lroboguice/util/SafeAsyncTask$Task;->a()Ljava/lang/Object;

    move-result-object v0

    invoke-virtual {p0, v0}, Lroboguice/util/SafeAsyncTask$Task;->a(Ljava/lang/Object;)V
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    .line 175
    invoke-virtual {p0}, Lroboguice/util/SafeAsyncTask$Task;->d()V

    .line 178
    :goto_0
    const/4 v0, 0x0

    return-object v0

    .line 167
    :catch_0
    move-exception v0

    .line 169
    :try_start_1
    invoke-virtual {p0, v0}, Lroboguice/util/SafeAsyncTask$Task;->a(Ljava/lang/Exception;)V
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_1

    .line 175
    :goto_1
    invoke-virtual {p0}, Lroboguice/util/SafeAsyncTask$Task;->d()V

    goto :goto_0

    :catchall_0
    move-exception v0

    invoke-virtual {p0}, Lroboguice/util/SafeAsyncTask$Task;->d()V

    throw v0

    .line 170
    :catch_1
    move-exception v0

    goto :goto_1
.end method

.method protected c()V
    .locals 1

    .prologue
    .line 182
    new-instance v0, Lroboguice/util/SafeAsyncTask$Task$1;

    invoke-direct {v0, p0}, Lroboguice/util/SafeAsyncTask$Task$1;-><init>(Lroboguice/util/SafeAsyncTask$Task;)V

    invoke-virtual {p0, v0}, Lroboguice/util/SafeAsyncTask$Task;->a(Ljava/util/concurrent/Callable;)V

    .line 188
    return-void
.end method

.method public bridge synthetic call()Ljava/lang/Object;
    .locals 1

    .prologue
    .line 153
    invoke-virtual {p0}, Lroboguice/util/SafeAsyncTask$Task;->b()Ljava/lang/Void;

    move-result-object v0

    return-object v0
.end method

.method protected d()V
    .locals 1

    .prologue
    .line 221
    new-instance v0, Lroboguice/util/SafeAsyncTask$Task$4;

    invoke-direct {v0, p0}, Lroboguice/util/SafeAsyncTask$Task$4;-><init>(Lroboguice/util/SafeAsyncTask$Task;)V

    invoke-virtual {p0, v0}, Lroboguice/util/SafeAsyncTask$Task;->a(Ljava/util/concurrent/Callable;)V

    .line 227
    return-void
.end method
